home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: asciizero@aol.com (ASCII zero)
- Newsgroups: comp.lang.c
- Subject: Re: How to Display a File Backwards?
- Date: 17 Feb 1996 11:56:51 -0500
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4g51cj$t6o@newsbf02.news.aol.com>
- References: <4g3eplINNo0k@keats.ugrad.cs.ubc.ca>
- Reply-To: asciizero@aol.com (ASCII zero)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- OK, I owe you more explanation of my dilemma so here it is.
-
- I have a message log file (text) that gets updated on a regular basis
- depending on what errors the system detects during the course of its
- operation. Now, I want a tool that would display the contents of the
- message log beginning from the last line or the latest entry. This tool
- will run every 30 minutes. The message log will be updated in-between tool
- runs (i.e. when the file is not being displayed).
-
- If the message log contains the following lines:
- 96-02-16/11:15:23 Error number 1
- 96-02-16/11:31:01 Message number 110
- 96-02-16/14:00:59 Error number 51
- 96-02-16/23:14:13 Error number 6
-
- the screen display should show:
- 96-02-16/23:14:13 Error number 6
- 96-02-16/14:00:59 Error number 51
- 96-02-16/11:31:01 Message number 110
- 96-02-16/11:15:23 Error number 1
-
- Notes:
- (1) I'm not sure if I have enough memory to hold the file because the
- file's size is likely to vary as time moves on.
- (2) I can't use functions that are not included in the standard ANSI C
- library
- (3) I can go to the end of the file and I *think* I can even display the
- last line in readable form (not backwards), but I'm not sure about taking
- it from there on because I'm always assuming that no two lines are equal
- in length.
-
- I really hope I'm making some sense here. :) Please post or mail any
- suggestions you may have. Thanks!
-
- James
- ASCIIzero@aol.com(J. J. Cariaso)
-